package com.twu.biblioteca;

public class CheckoutItemCommand implements Command {
    private final Library library;

    public CheckoutItemCommand(Library library) {
        this.library = library;
    }

    public String call(Object[] arguments) {
        boolean successfulCheckout = library.checkoutItem(arguments[0].toString());
        if (successfulCheckout) {
            return "Thank you! Enjoy the book\n";
        }
        return "That book is not available.\n";
    }
}